package com.zuul;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 *
 * @author Jack01
 *
 */
@SpringBootApplication
@EnableZuulProxy
@RestController
@RequestMapping("/*")
public class ZuulEntry {


	@Autowired
	private RestTemplate restTemplate;

	public static void main(String[] args) throws Exception {
		SpringApplication.run(ZuulEntry.class, args);
	}

	@RequestMapping("/service-balanced")
	public String service() {
		return restTemplate.getForObject("http://TEST-SERVICE/service", String.class);
	}
}
